<template>
  <div class="order">
    <div class="headern">
      <div @click="goBack"
           style="float: left">
        <a-icon type="left"
                class="icon" />
        <a class="h3">历史预约</a>
      </div>
    </div>
    <div v-html="message.content"></div>
    <newsinfo :message="message"></newsinfo>
  </div>
</template>

<script>
import newsinfo from './newsInfo'
import urls from '../../common.js'
export default {
  name: 'headern',
  data () {
    return {
      message: []
    }
  },
  components: {
    newsinfo
  },
  created () {
    // this.getGroupsList()
    this.getMessage()
  },
  methods: {
    goBack () {
      this.$router.push('/')
    },
    getMessage () {
      console.log(this.$store.state.cardNo)
      var that = this
      this.$http.get(urls.queryHistoryAppointmentByCardNo + '?cardNo=' + that.$store.state.cardNo).then(result => { // 获取历史预约
        console.log(result.body)
        if (result.body.code === '200') {
          that.message = result.body.data
        }
      })
    }
  }
}
</script>

<style lang="stylus" scoped>
@import '../../../static/css/color.styl'
.order
  position relative
  background-color $color-grayc
  height 100%
.headern
  height 0.98rem
  background-color $color-main
  text-align justify
  line-height 0.98rem
  padding-left 0.3rem
  color $color-white
  margin-bottom 0.3rem
  .icon
    font-size 0.36rem
    color $color-white
    vertical-align -0.06rem
  .h3
    display inline-block
    font-size 0.36rem
    color $color-white
  .chargeback
    height 100%
    float right
    line-height 1rem
    font-size 0.32rem
    margin-right 0.4rem
    .icon
      width 0.25rem
      height 0.3rem
      background url('../../../static/images/Order2/message1.png') no-repeat
      background-size 100%
      margin-top 0.37rem
      margin-right 0.15rem
      float left
    .span
      color $color-white
      font-weight normal
    .time
      margin-left 0.6rem
      color $color-orderone
.anticon
  font-size 0.26rem
  vertical-align -0.23em
</style>
